package com.test.mytag;

import java.io.IOException;
import java.util.Date;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

public class MyTag1 extends TagSupport{
	
	
	public int doEndTag() throws JspException {

		//String dateString = new Date().toString();
		Date date = new Date();
		String dateString =  date.toString();
		try {
			pageContext.getOut().write("MyTag Success!!现在时间是:"+dateString);
			//JspWriter writer = super.pageContext.getOut();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return EVAL_PAGE;
	}


	public int doStartTag() throws JspException {

		return EVAL_BODY_INCLUDE;
	}
}
